package com.ken.spring.factroybean;

import com.ken.spring.Car;

import java.util.HashMap;
import java.util.Map;

public class InstanceCarFactory {
    private Map<String, Car> map = null;

    public InstanceCarFactory() {
        map = new HashMap<>();
        map.put("Audi", new Car("Audi", 500000));
        map.put("Baoma", new Car("Baoma", 400000));
    }

    private Car getCar(String name) {
        return map.get(name);
    }
}
